﻿#ifndef PYINTERPRETER_H
#define PYINTERPRETER_H

#include <QObject>
#include <QStringList>

namespace ScriptManager
{
    class PythonAgent;

    class PyInterpreter : public QObject
    {
        Q_OBJECT
    public:
        PyInterpreter() = default;
        ~PyInterpreter();

        bool init(PythonAgent* agent, QString pythonPath);
        int execCode(QString code,bool save = true);
        void execFile(QString file);
        int getCodeCount();
        QString getCodeAt(int i);
        void codeListAppend(QString qs);
        QStringList getCode();
        void clearCode();
    private:
        QStringList _codelist{};
        PythonAgent* _agent{};
    };

}

#endif
